import Vue from 'vue'
import Router from 'vue-router'

const Home = () => import('../pages/Home/Home.vue')
const Chat = () => import('../pages/Chat/Chat')
const Me = () => import('../pages/Me/Me')
const Recommend = () => import('../pages/Recommend/Recommend')
import Search from '../pages/Search/Search'

import Box from '../pages/Home/children/Box'
import Dress from '../pages/Home/children/Dress'
import Ele from '../pages/Home/children/Ele'
import Food from '../pages/Home/children/Food'
import General from '../pages/Home/children/General'
import Hot from '../pages/Home/children/Hot'
import Man from '../pages/Home/children/Man'
import Mbaby from '../pages/Home/children/Mbaby'
import Shirt from '../pages/Home/children/Shirt'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      component: Home,
      children: [
        { path: 'box', component: Box },
        { path: 'dress', component: Dress },
        { path: 'ele', component: Ele },
        { path: 'food', component: Food },
        { path: 'general', component: General },
        { path: 'hot', component: Hot },
        { path: 'man', component: Man },
        { path: 'mbaby', component: Mbaby },
        { path: 'shirt', component: Shirt },
        { path: '/home', redirect: '/home/hot' }
      ]
    },
    {
      path: '/chat',
      component: Chat
    },
    {
      path: '/me',
      component: Me
    },
    {
      path: '/recommend',
      component: Recommend
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/',
      redirect: '/home'
    }
  ]
})
